<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Admin
 * Date: 03.09.13
 * Time: 11:09
 * To change this template use File | Settings | File Templates.
 */

abstract class AbstractParserRow
{
	protected $_arr = '';

	public function setArray($row)
	{
		$this->_arr = $row;
	}

	public function getArray()
	{
		return $this->_arr;
	}


    public function __set($field, $value)
    {
        $method = 'set'.ucfirst($field);

        if(method_exists($this, $method))
            return call_user_func(array($this, $method), $value);

        $field = '_'. $field;

        if(isset($this->$field))
            return $this->$field = $value;
    }

    public function __get($field)
    {
        $method = 'get'.ucfirst($field);

        if(method_exists($this, $method))
            return call_user_func(array($this, $method));

        $field = '_'. $field;
        
        if(isset($this->$field))
            return $this->$field;

        return null;
    }

}